home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
cug106
/
stdio.lib
< prev
next >
Wrap
Text File
|
1984-06-14
|
2KB
|
59 lines
/* stdio.lib
Copyright (C) 1980, M J Maney
First created 3/15/80
Last revised 3/15/80
This library provides the defines and data declarations for the
stdio functions, which are an attempt to simulate some of the
things that a really nice OS (like UNIX) gives you in a less nice
enviornment (BDS C running under CP/M).
To work properly, this file MUST be included into the source of
any program that wants to use the stdio functions, and the
library file csym.lib must also be included. These two files
MUST be the first two files included, and they MUST be included
in the sequence
#include "csym.lib"
#include "stdio.lib"
BEFORE any inline declarations of external (global) variables,
and that includes any such declarations in any other file which
is included! To be safe, just make the above two lines the first
non-comment lines of the source. NB that they must be included
in ALL source files for the program that declare globals!!
*/
/* define STDIN and STDOUT to work with getc & putc ONLY */
#define STDIN (_stdin==FILE ? _inpbuf : 0)
#define STDOUT (_stdout==FILE ? _outbuf : 1)
/* declare globals for stdio functions */
char _stdin,_stdout;
char _inpbuf[IOBUFSIZ],_outbuf[IOBUFSIZ];
char _inpname[FNAMSIZ],_outname[FNAMSIZ];
int _inpfd,_outfd;
char _filter;
n() in the
FIRST character position of an argument.
If the "filter" argument is true, and stdopen finds a STDIN arg,
but stdio.doc, an attempt to explain things.
The files that I've sent to the BDS C user's group include the
early versions of the code I used for simulating the UNIX facility
for invisible redirection of STDIN and STDOUT files. These
are not a finished product by any means, and you MUST understand
their operation to use them sucessfully!
A little history will help. The first version of stdio was written
before I had recieved the 1.32 (or 1.31+) version of the BDS
software, and before I decided to rewrite most of the I/O
functions. I have since been sidetracked and otherwise occupied,
so that neither of these interlocked projects is completed, and I
cannot honestly attempt to guess just when such completion may
occur. So. The files I sent are believed to be the final version
of the original effort, and will certainly suffice to demonstrate
the concept I us